#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include "stu_mis.h"
#include <stdlib.h>

void stu_show()
{
    printf("\t┏━━━━━━━━━━━━━━━━━━━━━━━━━┓\n");
    printf("\t┃           欢迎使用学生管理系统BetaV1.3           ┃\n");
    printf("\t┃                               by hht      ┃\n");

    struct student s;
    FILE *fp = fopen("student_info.txt", "r");
    if (fp == NULL)
    {
    	perror("open file fail");
    	return;
    }
    while (fread(&s, sizeof(s), 1, fp) == 1)
    {
        printf("\t┃学号：%d->->->姓名：%s->->->性别：%s->->->成绩：%f┃\n", s.num, s.name, s.sex, s.grades);
    }

    fclose(fp);

    printf("\t┃                                                  ┃\n");
    printf("\t┗━━━━━━━━━━━━━━━━━━━━━━━━━┛\n\n");

    return;
}
